<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
	<p:panel header="#{msgs.planejamento}">
		<p:accordionPanel>
			<p:tab title="#{msgs.HypothesisFormulation}">
				<h:panelGrid columns="1">
					<h:outputText value="#{msgs.NullHypothesis}" />
					<p:inputText value="#{protocolMB.planning.nullHypotheses}" size="110" />
				</h:panelGrid>
				<br />
				<h:outputText value="#{msgs.AlternativeHypothesis}" size="100" />
				<h:panelGrid columns="2">
					<p:inputText id="ah" value="#{protocolMB.alternativeHypotheses.description}" size="100" />
					<p:commandButton icon="ui-icon-plusthick"
						action="#{protocolMB.adicionaAH}" update="listHypotheses ah"
						ajax="true" />
				</h:panelGrid>

				<p:dataTable id="listHypotheses" value="#{protocolMB.lAlternativeHypotheses}" var="hyp" emptyMessage="#{msgs.semdados}">
					<p:column headerText="Description">
						<h:outputText value="#{hyp.description}" />
					</p:column>
				</p:dataTable>
			</p:tab>

			<p:tab title="#{msgs.Variables}">
				<p:fieldset legend="#{msgs.Dependentes}">
					<h:form id="dep">
					<h:panelGrid id="vd" columns="3">
						<h:outputText value="#{msgs.Name}" />
						<p:inputText value="#{protocolMB.variable.name}" />
						<h:inputHidden />
						
						<h:outputText value="#{msgs.Description}" />
						<p:inputText value="#{protocolMB.variable.description}" />

						<p:commandButton icon="ui-icon-plusthick"
							action="#{protocolMB.adicionaVD}" update="vd dependentes"
							ajax="true" process="dep" />
							
					</h:panelGrid>

					<p:dataTable id="dependentes" value="#{protocolMB.listaVD}" var="dep">
						<p:column headerText="#{msgs.Name}">
							<h:outputText value="#{dep.name}" />
						</p:column>
						<p:column headerText="#{msgs.Description}">
							<h:outputText value="#{dep.description}" />
						</p:column>
					</p:dataTable>
				</h:form>
				</p:fieldset>
				
				<br/>
				
				<p:fieldset legend="#{msgs.Independets}">
					<h:form id="indep">
					<h:panelGrid id="vi" columns="3">
						<h:outputText value="#{msgs.Name}" />
						<p:inputText value="#{protocolMB.variable.name}" />
						<h:inputHidden/>

						<h:outputText value="#{msgs.Description}" />
						<p:inputText value="#{protocolMB.variable.description}" />

						<p:commandButton icon="ui-icon-plusthick"
							action="#{protocolMB.adicionaVI}" update="vi independentes"
							ajax="true" process="indep" />
							
					</h:panelGrid>

					<p:dataTable id="independentes" value="#{protocolMB.listaVI}" var="ind">
						<p:column headerText="#{msgs.Name}">
							<h:outputText value="#{ind.name}" />
						</p:column>
						<p:column headerText="#{msgs.Description}">
							<h:outputText value="#{ind.description}" />
						</p:column>
					</p:dataTable>
					</h:form>
				</p:fieldset>
			</p:tab>

			<p:tab title="#{msgs.SubjectsSelection}">
				<h:panelGrid columns="2">
					<h:outputText value="#{msgs.SubjectsSelection}" />
					<p:inputText value="#{protocolMB.planning.subjectSelection}" />
				</h:panelGrid>
			</p:tab>

			<p:tab title="#{msgs.GroupsSelection}">
				<h:panelGrid columns="2">

					<h:outputText value="#{msgs.Criteria}" />
					<p:inputText value="#{protocolMB.planning.groupCriteria}" size="100" />
					
				</h:panelGrid>
				
				<br/>
				
				<h:form id="group">
				<h:panelGrid columns="3">

					<h:outputText value="#{msgs.GroupName}" />
					<p:inputText value="#{protocolMB.group.name}" />
					<h:inputHidden/>

					<h:outputText value="#{msgs.GroupDescription}" />
					<p:inputText value="#{protocolMB.group.description}" />

					<p:commandButton icon="ui-icon-plusthick"
						action="#{protocolMB.adicionaGrupo}" update="group" ajax="true" process="group" />
				</h:panelGrid>

				<p:dataTable id="groups" value="#{protocolMB.listGroups}" var="group">
					<p:column headerText="#{msgs.Name}">
						<h:outputText value="#{group.name}" />
					</p:column>
					<p:column headerText="#{msgs.Description}">
						<h:outputText value="#{group.description}" />
					</p:column>
				</p:dataTable>
				</h:form>

			</p:tab>

			<p:tab title="#{msgs.Detalhes}">
				<h:panelGrid columns="1">
					<h:outputText value="#{msgs.Resources}" />
					<p:editor value="#{protocolMB.definition.questionNotAnswered}" />

					<h:outputText value="#{msgs.ExperimentalDesign}" />
					<p:editor value="#{protocolMB.definition.openQuestion}" />

					<h:outputText value="#{msgs.Instrumentation}" />
					<p:editor value="#{protocolMB.definition.questionNotAnswered}" />

					<h:outputText value="#{msgs.AnalysisMechanisms}" />
					<p:editor value="#{protocolMB.definition.openQuestion}" />
				</h:panelGrid>
			</p:tab>

			<p:tab title="#{msgs.ResultsValidity}">
				<h:panelGrid columns="1">
					<h:outputText value="#{msgs.Internal}" />
					<p:editor value="#{protocolMB.definition.questionNotAnswered}" />

					<h:outputText value="#{msgs.External}" />
					<p:editor value="#{protocolMB.definition.openQuestion}" />

					<h:outputText value="#{msgs.Conclusion}" />
					<p:editor value="#{protocolMB.definition.questionNotAnswered}" />

					<h:outputText value="#{msgs.Construction}" />
					<p:editor value="#{protocolMB.definition.openQuestion}" />
				</h:panelGrid>
			</p:tab>

		</p:accordionPanel>
	</p:panel>
</ui:fragment>